package com.blog.controller.base;

import java.util.UUID;

import org.springframework.web.bind.annotation.CrossOrigin;

import com.blog.domain.wrapper.DomainWrapper;
import com.blog.logger.LoggerBase;
@CrossOrigin
public abstract class BaseController extends LoggerBase {

    protected <T> DomainWrapper<T> processException(Throwable e) {
        DomainWrapper<T> dm = new DomainWrapper<T>();
        dm.setCode(UUID.randomUUID().toString());
        dm.setMsg("failure");
//        dm.setData("");
        logger.error(dm.getCode());
        e.printStackTrace();
        return dm;
    }
}
